package com.uubx.pojo;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;

import javax.persistence.Id;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2020-12-29 16:23:22
 */
@ApiModel(description = "User数据")
public class User implements Serializable {
    private static final long serialVersionUID = 367600099924093814L;
            @Id
            private Integer id;
    /**
    * 用户名
    */        @ApiModelProperty("用户名")
        private String username;
    @ApiModelProperty("密码")
            private String password;
    /**
    * 联系方式
    */        @ApiModelProperty("联系方式")
        private String phone;
    /**
    * 加密盐值
    */        @ApiModelProperty("加密盐值")
        private String salt;
    /**
    * 创建时间
    */        @ApiModelProperty("创建时间")

        private Date createTime;
    /**
    * 最后登录时间
    */        @ApiModelProperty("最后登录时间")

        private Date lastLoginTime;
    /**
    * 用户状态：1有效; 2删除
    */        @ApiModelProperty("状态：0未启用; 1已启用")
        private Integer status;
    /**
    * 部门外键
    */        @ApiModelProperty("部门外键")
        private Integer departmentId;
    /**
    * 角色外键
    */        @ApiModelProperty("角色外键")
        private Integer roleId;
    @ApiModelProperty("token")
    private String token;
    @ApiModelProperty("部门名字")
    private String departmentName;
    @ApiModelProperty("角色名字")
    private String roleName;

    //用户菜单信息
    private List<Menu> menus;

    //用户权限信息
    private List<Permission> permissions;

    public List<Menu> getMenus() {
        return menus;
    }

    public void setMenus(List<Menu> menus) {
        this.menus = menus;
    }

    public List<Permission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

    public User() {
    }

    public User(Integer id, String username, String password, String phone, String salt, Date createTime, Date lastLoginTime, Integer status, Integer departmentId, Integer roleId, String token, String departmentName, String roleName) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.salt = salt;
        this.createTime = createTime;
        this.lastLoginTime = lastLoginTime;
        this.status = status;
        this.departmentId = departmentId;
        this.roleId = roleId;
        this.token = token;
        this.departmentName = departmentName;
        this.roleName = roleName;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
}